package com.assess.web.enums;

/**
 * Created by guoqi.
 */
public class EnumModel {


    /**
     * 类型
     */
    public static enum EnumType {
        Format(0, "业态"),
        Phases(1, "施工阶段"),
        Scope(2, "抽取范围");

        private int key;
        private String desc;

        EnumType(int key, String desc) {
            this.key = key;
            this.desc = desc;
        }

        public int getKey() {
            return key;
        }

        public String getDesc() {
            return desc;
        }

        public static EnumType getByKey(int key) {
            EnumType[] types = EnumType.values();
            for (EnumType type : types) {
                if (type.getKey() == key) {
                    return type;
                }
            }
            return null;
        }
    }
}
